import 'package:boss/ui/widget/center_title_app_bar.dart';
import 'package:flutter/material.dart';
import 'package:hi_common/hi_common.dart';
import 'package:router/annotation.dart';
import 'widget/booking_search_browser.dart';

@RouterConfig(BookingSearchPage.pageName)
class BookingSearchPage extends StatefulWidget {
  static const pageName = '/BookingSearchPage';

  @Autowired()
  final String status;

  @Autowired()
  final String titleEnum;

  @Autowired()
  final DateTime startTime;

  @Autowired()
  final DateTime endTime;

  @Autowired()
  final DateTime beginArrive;

  @Autowired()
  final DateTime endArrive;

  const BookingSearchPage({
    this.status,
    this.titleEnum,
    this.startTime,
    this.endTime,
    this.beginArrive,
    this.endArrive,
    Key key,
  }) : super(key: key);

  @override
  _BookingSearchPageState createState() => _BookingSearchPageState();
}

class _BookingSearchPageState extends BaseState<BookingSearchPage> {
  _BookingSearchPageState() : super(BookingSearchPage.pageName);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CenterTitleAppBar(
        title: '高级查询',
      ),
      body: BookingSearchBrowser(
        titleEnum: widget.titleEnum,
        status: widget.status,
        startTime: widget.startTime,
        endTime: widget.endTime,
        beginArrive: widget.beginArrive,
        endArrive: widget.endArrive,
      ),
    );
  }
}
